package zjc.DeviceManage.util;

import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;

/**
 * 作者：zxl on 2020/7/16 22:55
 * 邮箱：510252916@qq.com
 */
public class MyHttpUtil {
    public static  String host="http://192.168.247.1:8080";
    public static  void sendOkhttPostRequest(String address, RequestBody requestBody, Callback callback){
        OkHttpClient client=new OkHttpClient();
        Request request=new Request.Builder().url(address).post(requestBody).build();
        client.newCall(request).enqueue(callback);
    }
    public static void  sendOkhttpGetRequest(String address,Callback callback){
        OkHttpClient client=new OkHttpClient();
        Request request=new Request.Builder().url(address).build();
        client.newCall(request).enqueue(callback);
    }
}
